package org.fit.pdfdom;

import lombok.extern.slf4j.Slf4j;
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.graphics.image.PDImage;
import org.apache.pdfbox.rendering.PDFRenderer;

import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.List;

@Slf4j
public class ShapeDrawer {
    private BufferedImage bufferedImage;
    private GeneralPath linePath = new GeneralPath();
    private Graphics2D graphics;
    private RenderingHints renderingHints;
    private AffineTransform xform;
    private PDFRenderer renderer;
    private PDRectangle pageSize;
    private Area lastClip;
    private Shape initialClip;
    private List<Shape> textClippings;
    private int nestedHiddenOCGCount;


    private void setRenderingHints() {
        graphics.addRenderingHints(renderingHints);
    }


    public void appendRectangle(Point2D p0, Point2D p1, Point2D p2, Point2D p3) throws IOException {
        linePath.moveTo((float) p0.getX(), (float) p0.getY());
        linePath.lineTo((float) p1.getX(), (float) p1.getY());
        linePath.lineTo((float) p2.getX(), (float) p2.getY());
        linePath.lineTo((float) p3.getX(), (float) p3.getY());
        linePath.closePath();
    }

 
    public void drawImage(PDImage pdImage) throws IOException {

    }

 
    public void clip(int windingRule) throws IOException {
    }

 
    public void moveTo(float x, float y) throws IOException {
        linePath.moveTo(x, y);
    }

 
    public void lineTo(float x, float y) throws IOException {

    }

 
    public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) throws IOException {

    }

 
    public Point2D getCurrentPoint() throws IOException {
        return null;
    }

 
    public void closePath() throws IOException {
        linePath.closePath();
    }

 
    public void endPath() throws IOException {

    }


 
    public void strokePath() throws IOException {

    }


 
    public void fillPath(int windingRule) throws IOException {

    }

    private boolean isContentRendered() {
        return nestedHiddenOCGCount <= 0;
    }

 
    public void fillAndStrokePath(int windingRule) throws IOException {

    }

 
    public void shadingFill(COSName shadingName) throws IOException {

    }
}
